#/bin/bash

prog="lean"
logsForder="../logs"

echo "kill $prog process..."
ps -ef | grep -i $prog | grep -v "grep"
killall $prog

echo "Starting $prog process..."
mkdir -p  $logsForder

nohup ./$prog >> $logsForder/$prog.log 2>&1 &
ps -ef | grep -i $prog | grep -v "grep"

echo "Sleep 5 seconds..."
sleep 5
tail -n 30 $logsForder/$prog.log